﻿-- =====================================================
-- Author:			Javan, Amir
-- Create date:		1390/02/07
-- Description:     Fetch PayAndReceive by condition
-- =====================================================
CREATE PROCEDURE [dbo].[uspPayAndReceiveItemFetchCondition]
	@condition nvarchar(500)
AS
BEGIN
	DECLARE @query nvarchar(2000)
	SET @query = 'SELECT * 
	FROM [PayAndReceiveItem]'
	IF @Condition IS NOT NULL
		IF @Condition <> ''
			SET @query = @query + ' WHERE ' + @condition
	EXEC(@query)
END